﻿#ifndef MCUCODEC_H
#define MCUCODEC_H

#include <qobject.h>
#include "ObjAutoInject.h"
#include "MCUCodecBase.h"
#include <qbytearray.h>
#include <qhash.h>
#include <qtimer.h>

class MCUCodec : public QObject, public ObjAutoInject, public MCUCodecBase
{
  Q_OBJECT
/*
 * deviceId设备编号，32bit
 * MCU操作类型8bit，后续载荷中的数据由子解析器解析
 * 操作数据
*/
private://property
  QHash<unsigned char,MCUCodecBase*> codecMap;
private://dependency
public:
  explicit MCUCodec();
  virtual ~MCUCodec();
signals:
public:
  virtual void decode(QByteArray data)override;
  void addToCodecMap(uchar type,MCUCodecBase* mCUCodecBase);
public://geter and seter
public:
  virtual void objectAutoInjection(QHash<QString,QObject*>* objMap)override;
};

#endif // MCUCODEC_H
